package com.heima.account.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IAccountAction {
    @TwoPhaseBusinessAction(name = "deduct",commitMethod = "success",rollbackMethod = "fail")
    public void deduct(@BusinessActionContextParameter(paramName = "userId") Integer userId,
                       @BusinessActionContextParameter(paramName = "userId") Integer money);

    public boolean success(BusinessActionContext context);

    public boolean fail(BusinessActionContext context);
}
